package wevil.spring.conf;

/**
 * 数据源切换
 * Created by Administrator on 2017/11/2.
 */
public class CustomerContextHolder {
    public static final String SESSION_FACTORY_MYSQL = "sessionFactoryMysql";
    public static final String SESSION_FACTORY_ORACLE = "sessionFactoryOracle";

    private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();

    public static void setCustomerType(String dbType) {
        contextHolder.set(dbType);
    }

    public static String getCustomerType() {
        return contextHolder.get();
    }

    public static void clearCustomerType() {
        contextHolder.remove();
    }
}
